<?php
class Admin_Model_Category extends Zend_Db_Table_Abstract
{
	protected $_name= "loaisp";
	
	public function getCategory($id)
	{
		$TL=$this->fetchAll('idTL='.$id,'idLoai ASC');
		return $TL;
	}
	public function addCategory($nameCat,$idSes,$keyWord)
	{
		$data = array(
            'TenLoai' => $nameCat,
			'idTL'	  => $idSes,
            'keywork' => $keyWord,
        );
        $this->insert($data);
		
	}
	public function editCategory($idCat,$nameCat,$idSes,$keyWord)
	{
		$data = array(
            'TenLoai' => $nameCat,
			'idTL'	  => $idSes,
            'keywork' => $keyWord,
        );
        $this->update($data,'idLoai='.$idCat);
		
	}
	public function deleteCategory($idCat)
	{
	
        $this->delete('idLoai='.$idCat);
		
	}
	
}